﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;

namespace Gfw.Web.Models.User
{
    /// <summary>
    /// 用户详细基本信息表
    /// <para>该类用于拷贝相关信息，修饰符、类型、字段名称、读写操作 都应一致！</para>
    /// <para>若存在不一致的情况时，在逻辑里进行进一步逻辑操作。如：新增字段、int -> string 等</para>
    /// </summary>
    public class UserDetailInfoModel
    {
        [Key]
        [Required]
        [DataType(DataType.Text)]
        [Display(Name = "用户ID：", AutoGenerateField = false)]
        public string Id { get; set; }

        [Required]
        [DataType(DataType.Text)]
        [Display(Name = "用户登录名：")]
        public string LoginName { get; set; }

        [DataType(DataType.Text)]
        [Display(Name = "姓名：")]
        public string Name { get; set; }

        [DataType(DataType.PhoneNumber)]
        [Display(Name = "联系电话：")]
        public string Tel { get; set; }

        [DataType(DataType.Text)]
        [Display(Name = "联系地址：")]
        public string Address { get; set; }

        [DataType(DataType.Text)]
        [Display(Name = "QQ：")]
        public string Qq { get; set; }

        [DataType(DataType.EmailAddress)]
        [Display(Name = "电子邮件：")]
        public string Email { get; set; }

        [DataType(DataType.Text)]
        [Display(Name = "身份证号：")]
        [RegularExpression(@"\d{17}[\d|X]|\d{15}", ErrorMessage = "身份证号错误")]
        public string IdCard { get; set; }

        [DataType(DataType.Text)]
        [Display(Name = "注册顺序号：")]
        public int UserIndex { get; set; }

        [DataType(DataType.DateTime)]
        [Display(Name = "注册日期：")]
        public DateTime? RegistrationDate { get; set; }

        [DataType(DataType.DateTime)]
        [Display(Name = "账户激活日期：")]
        public DateTime? ActivationDate { get; set; }

        [DataType(DataType.Text)]
        [Display(Name = "父节点姓名：")]
        public string ParentName { get; set; }

        [DataType(DataType.Text)]
        [Display(Name = "推荐人姓名：")]
        public string RecommenderName { get; set; }

        [DataType(DataType.Text)]
        [Display(Name = "我的推荐会员左区总计人数：")]
        public long LeftChildrenCount { get; set; }

        [DataType(DataType.Text)]
        [Display(Name = "我的推荐会员右区总计人数：")]
        public long RightChildrenCount { get; set; }

        //BMK
        /// <summary>
        /// 注：这里是 string 类型
        /// </summary>
        [DataType(DataType.Text)]
        [Display(Name = "账户是否停用：")]
        public string IsLock { get; set; }

        [DataType(DataType.DateTime)]
        [Display(Name = "账户停用日期：")]
        public DateTime? LockDate { get; set; }

        [DataType(DataType.MultilineText)]
        [Display(Name = "原因：")]
        public string LockReason { get; set; }        
    }
}
